<template>
  <div class="view-count-scroll">
    <fx-card title="基础用法">
      <fx-row>
        <fx-col>
          <fx-count-scroll :count="count" class="fs30" height="32px"/>
        </fx-col>
      </fx-row>
      <fx-row>
        <fx-col>
          <fx-input-number v-model="count" class="mt10" :min="0" :max="500000000000"/>
        </fx-col>
      </fx-row>
      <template #hide>
        <pre v-highlight="base"><code></code></pre>
      </template>
    </fx-card>
    <fx-card title="滚动">
      <fx-row>
        <fx-col :span="6">
          <fx-count-scroll :count="500" class="fs30" height="32px" :start="0"/>
        </fx-col>
        <fx-col :span="6">
          <fx-count-scroll :count="0" class="fs30" height="32px" :start="500"/>
        </fx-col>
      </fx-row>
      <template #hide>
        <pre v-highlight="scroll"><code></code></pre>
      </template>
    </fx-card>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'

export default defineComponent({
  name: 'viewCountScroll',
  setup () {
    const count = ref<number>(50000000000)

    const base = `<fx-row>
  <fx-col>
    <fx-count-scroll :count="count" class="fs30" height="32px"/>
  </fx-col>
</fx-row>
<fx-row>
  <fx-col>
    <fx-input-number v-model="count" class="mt10" :min="0"/>
  </fx-col>
</fx-row>`

    const scroll = `<fx-row>
  <fx-col :span="6">
    <fx-count-scroll :count="500" class="fs30" height="32px" :start="0"/>
  </fx-col>
  <fx-col :span="6">
    <fx-count-scroll :count="0" class="fs30" height="32px" :start="500"/>
  </fx-col>
</fx-row>`

    return {
      count,
      base,
      scroll
    }
  }
})
</script>

<style scoped lang="scss">
.view-count-scroll {
}
</style>
